const HtmlPlugin = require('html-webpack-plugin');
const {VueLoaderPlugin} = require('vue-loader');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');

module.exports={
    devServer:{},
    output:{
        filename:'file-uploader.js'
    },
    module:{
        rules:[
            {
                test:/\.png|jpe?g/,
                use:'url-loader',
            },
            {
                test:/\.js/,
                use:['babel-loader'],
            },
            {
                test:/\.vue/,
                use:'vue-loader'
            },
            {
                test:/\.scss/,
                use:['style-loader','css-loader','sass-loader'],
            }
        ]
    },
    externals:{
        vue:'Vue'
    },
    plugins:[
        new HtmlPlugin({
            template:'./src/index.html',
            inject:'head'
        }),
        new VueLoaderPlugin(),
        new CleanWebpackPlugin()
    ]
}